import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: require('@/components/Home').default,
      redirect: "/home/index",
      children: [
        {
          path: "index",
          name: "index",
          component: () => import("@/components/Home/Index.vue"),
          redirect: "/home/index/music",
          children: [
            { // 音乐
              path: 'music',
              name: "music",
              component: () => import("@/components/Home/Music.vue"),
              redirect: "/home/index/music/recommend",
              children: [
                {
                  path: 'recommend',
                  name: 'recommend',
                  component: () => import("@/components/Home/Music/Recommend.vue"),
                },
                {
                  path: 'newest',
                  name: 'newest',
                  component: () => import("@/components/Home/Music/Newest.vue"),
                },
                {
                  path: 'playlist',
                  name: 'playlist',
                  component: () => import("@/components/Home/Music/PlayList.vue"),
                },
                {
                  path: 'ranking',
                  name: 'ranking',
                  component: () => import("@/components/Home/Music/RankingList.vue"),
                },
                {
                  path: 'singerSquare',
                  name: 'singerSquare',
                  component: () => import("@/components/Home/Music/SingerSquare.vue"),
                },
              ]
            },
            {
              path: 'details',
              name: 'details',
              component: () => import("@/components/Home/Music/MusicList.vue"),
            },
            { // 歌手详情
              path: 'singer',
              name: 'singer',
              component: () => import("@/components/Home/Music/singer.vue"),
            },
            {  // 视频
              path: "video",
              name: "video",
              component: () => import("@/components/Home/Video.vue"),
            },
            {
              path: 'search',
              name: "search",
              component: () => import("@/components/Home/Music/SearchMusic.vue"),
            },
            {
              path: "localMusic",
              name: "localMusic",
              component: () => import("@/components/Home/LocalMusic.vue")
            }
          ]
        },
        {
          path: 'mvInfo',
          name: 'mvInfo',
          component: () => import("@/components/Home/Video/VideoInfo.vue"),
        },
        {  // 歌词
          path: 'lyrics',
          name: 'lyrics',
          component: () => import("@/components/Home/Music/MusicLyrics.vue"),
        },
      ]
    },
    {
      path: "/tray",
      name: "tray",
      component: () => import("@/components/Tray.vue")
    }

  ],
  linkActiveClass: 'active',
})
